]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Make the show apps button insensitive when we're dragging a non-favorite
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 2 Oct 2012 23:53:07 +0000 (20:53 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sat, 6 Oct 2012 19:07:54 +0000 (16:07 -0300)
This doesn't handle the tooltip case, unfortunately. That will come in a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=685313

js/ui/dash.js

index 047588d440243fd78ef14e219fb8deb49e612794..3a7828cf8dd31d63373ea064a5a48d4d69330446 100644 (file)
@@ -285,8 +285,16 @@ const ShowAppsIcon = new Lang.Class({
             this.setLabelText(_("Show Applications"));
     },
 
-    // Rely on the dragged item being a favorite
     handleDragOver: function(source, actor, x, y, time) {
+        let app = getAppFromSource(source);
+        if (app == null)
+            return DND.DragMotionResult.NO_DROP;
+
+        let id = app.get_id();
+        let isFavorite = AppFavorites.getAppFavorites().isFavorite(id);
+        if (!isFavorite)
+            return DND.DragMotionResult.NO_DROP;
+
         return DND.DragMotionResult.MOVE_DROP;
     },